package java复习202408.B_集合相关验证;

import org.junit.jupiter.api.Test;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class b2_集合继承关系验证 {

    @Test
    public void hashtableTest(){
        Hashtable ht = new Hashtable();
        ht.put("a",1);

        ConcurrentHashMap ch = new ConcurrentHashMap();
        ch.put("cha","ch1");

    }


    @Test
    public void hashmap64Test(){
        HashMap hashMap = new HashMap();
        for (int i = 0; i < 150000; i++) {
            hashMap.put("mapkey"+i,"mapvalue"+i);
        }
    }

    @Test
    public void hashmapTest(){
        Map hashMap = new HashMap();
        hashMap.put("a",1);
        Set set = hashMap.entrySet();
        Set set1 = hashMap.keySet();
        Collection values = hashMap.values();
        System.out.println(values);
        System.out.println(set);
        System.out.println(set1);



    }

    @Test
    public void setTest(){
        HashSet hashSet = new HashSet<>();
        hashSet.add("123");
        hashSet.add("124");
        hashSet.add("125");
        System.out.println(hashSet);


    }

    @Test
    public void test1(){
        List arrayList = new ArrayList();
        arrayList.add("array1");

        LinkedList linkList = new LinkedList();
        linkList.add("linkList1");
        linkList.addAll(arrayList);
        linkList.addFirst("linkList2");

        System.out.println(linkList);

        Set hashSet = new HashSet<>();


    }
}
